<template>
  <div class="inner">
    <el-tabs v-model="activeTab">
      <el-tab-pane v-for="tab in tabs" :key="tab.name" v-bind="tab">
        <component :is="tab.componentName"></component>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
module.exports = {
  components:{
    Search: httpVueLoader('./components/Search.vue'),
    List: httpVueLoader('./components/List.vue'),
    Management: httpVueLoader('./components/Management.vue'),
    Favorite: httpVueLoader('./components/Favorite.vue'),
  },
  provide() {
    return {
      app: this,
    };
  },
  data() {
    return {
      activeTab: "search",
      tabs: [
        { label: "装配", name: "search", componentName: "Search" },
        { label: "我的收藏", name: "favorite", componentName: "Favorite" },
        { label: "我的机芯", name: "list", componentName: "List" },
        { label: "机芯管理", name: "management", componentName: "Management" },
      ],
      dataset: {
        source: [],
        stars: [5,4,3,2,1],
        seasons: ['s2',"s1"],
        names: [
          "掘拓战车",
          "铁甲主脑",
          "格洛纳",
          "黑猎犬",
          "玛特",
          "联合三号",
          "吉利塔",
          "克拉肯",
          "梅瑞兹",
          "贝努",
          "海德",
          "大约翰",
          "战争图腾",
          "毁灭钢虫",
          "龙之助",
          "龙之助二型",
          "海撒旦",
          "大杰狂弹",
          "联合一号",
          "联合二号",
          "重坦舒尔",
          "恐爪战甲",
          "惊啸机甲",
          "雷式空母",
          "六臂神",
          "水渠潜艇",
          "沙暴潜艇",
          "合金支援",
          "太空坦克",
        ],
        mainProps: ["功击力", "生命值", "防御力"],
        directions: ["左", "上", "右"],
        properties: [
          "暴击率",
          "无视防御",
          "暴击伤害",
          "近程增伤",
          "远程增伤",
          "异常增伤",
          "命中率",
          "伤害减免",
          "格档率",
          "暴击抵抗",
          "闪避率",
          "无视防御抵抗",
          "暴伤抵抗",
          "格档抵抗",
        ],
        favorites: [],
      },
    }
  },
  mounted() {
    this.update();
  },
  methods: {
    update() {
      const data = storage.data();
      this.dataset.source = data.movements || [];
      this.dataset.favorites = data.favorites || [];
    },
  },
}
</script>

<style>

</style>